Component({
  data: {
    selected: 0,
    color: "#8D98AF",
    selectedColor: "#1B2431",
    list: [{
      pagePath: "/pages/index/index",
      iconPath: "../static/tab-home.png",
      selectedIconPath: "../static/tab-home-active.png",
      text: "首页"
    }, {
      pagePath: "/pages/order/index",
      iconPath: "../static/tab-order.png",
      selectedIconPath: "../static/tab-order-active.png",
      text: "订单"
    }]
  },
  attached() {
  },
  methods: {
    switchTab(e) {
      const data = e.currentTarget.dataset
      const url = data.path
      wx.switchTab({url})     
      this.setData({
        selected: data.index
      })    
    }
  }
})